package com.machinsight.library.controller;

import com.machinsight.library.bean.LoginUser;
import com.machinsight.library.dao.bean.UserInfoEntity;
import com.machinsight.library.model.ILoginBusinessModel;
import com.machinsight.library.model.LoginBusinessModelImpl;

/**
 * Copyright ©2017-2020 Machinsight Technology Co., Ltd.All rights reserved.
 * Author: Zhoushaohua
 * Date: 2020/1/2
 * Description:登录业务相关controller，登录操作不需要频繁的操作，故不需要写成单例
 */
public class LoginBusinessController {
    private ILoginBusinessModel mLoginModelImpl;

    public LoginBusinessController() {
        mLoginModelImpl = new LoginBusinessModelImpl();
    }

    /**
     * 根据用户输入账号密码来查询数据库中是否存在
     *
     * @param loginUser {@link LoginUser}
     * @return {@link UserInfoEntity}
     */
    public UserInfoEntity queryUserByNameAndPwd(LoginUser loginUser) {
        return mLoginModelImpl.queryUserByLoginUser(loginUser);
    }

}
